home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / ELECTRON / PCB_DESI / 1540.ZIP / PCBCA110.ZIP / EX1.PCB < prev    next >
Text File  |  1992-01-18  |  3KB  |  125 lines

  1. ; a circuit for calculating a parity bit for a 16-bit word (an xor tree)
  2. dimension (30,37)
  3.  
  4. ; 20 holes in a row = 1 inch
  5. hole (30,1)
  6. hole (30,2)
  7. hole (30,3)
  8. hole (30,4)
  9. hole (30,5)
  10. hole (30,6)
  11. hole (30,7)
  12. hole (30,8)
  13. hole (30,9)
  14. hole (30,10)
  15. hole (30,11)
  16. hole (30,12)
  17. hole (30,13)
  18. hole (30,14)
  19. hole (30,15)
  20. hole (30,16)
  21. hole (30,17)
  22. hole (30,18)
  23. hole (30,19)
  24. hole (30,20)
  25. hole (30,21)
  26.  
  27. ; chip definition -- quadruple 2-input xor gates
  28. chip type=ttl7486 pins=14 horizontal=2 vertical=6
  29.     vcc=14
  30.     gnd=7
  31.     a1=1
  32.     b1=2
  33.     y1=3
  34.     a2=4
  35.     b2=5
  36.     y2=6
  37.     y3=8
  38.     a3=9
  39.     b3=10
  40.     y4=11
  41.     a4=12
  42.     b4=13
  43.  
  44. ; power and ground are supplied here
  45. hole (3,20)
  46. hole (3,25)
  47.  
  48. ; the 16-bit input word
  49. hole (26,5)
  50. hole (26,7)
  51. hole (26,9)
  52. hole (26,11)
  53. hole (26,13)
  54. hole (26,15)
  55. hole (26,17)
  56. hole (26,19)
  57. hole (26,21)
  58. hole (26,23)
  59. hole (26,25)
  60. hole (26,27)
  61. hole (26,29)
  62. hole (26,31)
  63. hole (26,33)
  64. hole (26,35)
  65.  
  66. ; the output (parity) bit
  67. hole (3,11)
  68.  
  69. ; four instances of the above chip
  70. chipat (6,5) name=xor0 type=ttl7486 orientation=normal
  71. chipat (6,21) name=xor1 type=ttl7486 orientation=normal
  72. chipat (16,5) name=xor2 type=ttl7486 orientation=normal
  73. chipat (16,21) name=xor3 type=ttl7486 orientation=normal
  74.  
  75. ; connect power and ground to all chips
  76. priority connect (3,20) and xor0.vcc
  77. priority connect (3,20) and xor1.vcc
  78. priority connect (3,20) and xor2.vcc
  79. priority connect (3,20) and xor3.vcc
  80. priority connect (3,25) and xor0.gnd
  81. priority connect (3,25) and xor1.gnd
  82. priority connect (3,25) and xor2.gnd
  83. priority connect (3,25) and xor3.gnd
  84.  
  85. ; condense 16 bits into 8 bits
  86. connect (26,5) and xor2.a1
  87. connect (26,7) and xor2.b1
  88. connect (26,9) and xor2.a2
  89. connect (26,11) and xor2.b2
  90. connect (26,13) and xor2.a3
  91. connect (26,15) and xor2.b3
  92. connect (26,17) and xor2.a4
  93. connect (26,19) and xor2.b4
  94. connect (26,21) and xor3.a1
  95. connect (26,23) and xor3.b1
  96. connect (26,25) and xor3.a2
  97. connect (26,27) and xor3.b2
  98. connect (26,29) and xor3.a3
  99. connect (26,31) and xor3.b3
  100. connect (26,33) and xor3.a4
  101. connect (26,35) and xor3.b4
  102.  
  103. ; condense 8 bits into 4 bits
  104. connect xor2.y1 and xor1.a1
  105. connect xor2.y2 and xor1.b1
  106. connect xor2.y3 and xor1.a2
  107. connect xor2.y4 and xor1.b2
  108. connect xor3.y1 and xor1.a3
  109. connect xor3.y2 and xor1.b3
  110. connect xor3.y3 and xor1.a4
  111. connect xor3.y4 and xor1.b4
  112.  
  113. ; condense 4 bits into 2 bits
  114. connect xor1.y1 and xor0.a1
  115. connect xor1.y2 and xor0.b1
  116. connect xor1.y3 and xor0.a2
  117. connect xor1.y4 and xor0.b2
  118.  
  119. ; condense 2 bits into 1 bit
  120. connect xor0.y1 and xor0.a3
  121. connect xor0.y2 and xor0.b3
  122.  
  123. ; connect the output (parity) bit
  124. priority connect xor0.y3 and (3,11)
  125.